﻿using System.Collections;
using System.Collections.Generic;
using Fyber;
using UnityEngine;

namespace com.yd.sdk.imp
{
    public class FyberBannerListener : BannerListener
    {
        public delegate void OnErrorDelegate(string placementId, string error);
        public delegate void OnLoadDelegate(string placementId);
        public delegate void OnShowDelegate(string placementId, ImpressionData impressionData);
        public delegate void OnClickDelegate(string placementId);
        public delegate void OnRequestStartDelegate(string placementId);

        public OnErrorDelegate OnErrorHandler;
        public OnLoadDelegate OnLoadHandler;
        public OnShowDelegate OnShowHandler;
        public OnClickDelegate OnClickHandler;
        public OnRequestStartDelegate OnRequestStartHandler;
    
        public void OnError(string placementId, string error)
        {
            OnErrorHandler?.Invoke(placementId,error);
        }

        public void OnLoad(string placementId)
        {
            OnLoadHandler?.Invoke(placementId);
        }

        public void OnShow(string placementId, ImpressionData impressionData)
        {
            OnShowHandler?.Invoke(placementId,impressionData);
        }

        public void OnClick(string placementId)
        {
            OnClickHandler?.Invoke(placementId);
        }

        public void OnRequestStart(string placementId)
        {
            OnRequestStartHandler?.Invoke(placementId);
        }
    }

}

